<!DOCTYPE html>
<html lang="en">

<!-- Mirrored from uxliner.com/adminkit/demo/main/ltr/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 14 May 2021 17:30:44 GMT -->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>${title} - 机票预订系统</title>
<#include "../header.ftl">
<!-- Left side column. contains the logo and sidebar -->
<#include "../nav.ftl">
  
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper"> 
    <!-- Content Header (Page header) -->
    <div class="content-header sty-one">
      <h1>${title}</h1>
      <ol class="breadcrumb">
        <li><a href="/admin/index.html">主页</a></li>
        <li><i class="fa fa-angle-right"></i> ${title}</li>
      </ol>
    </div>
    
    <!-- Main content -->
    <div class="content">
      <div class="card">
      <div class="card-body">
      <div class="table-responsive">
      <div class="pull-left search-box">
        <form action="/admin/flight_list.html" method="get" class="search-form">
          <div class="input-group" style="padding-bottom:10px;">
            <input name="keyword" class="form-control" placeholder="根据航班号搜索" type="text" <#if keyword??>value="${keyword}"</#if>>
            <span class="input-group-btn">
            <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i> </button>
            </span></div>
        </form>
        </div>
        <button type="button" class="btn btn-outline-primary" style="float:right;" onclick="window.location='/admin/add_flight.html';">新增航班</button>
          <table class="table table-hover">
            <thead>
              <tr>
                <#--<th scope="col">#</th>-->
                <th scope="col">航班号</th>
                <th scope="col">航班公司</th>
                <th scope="col">机型</th>
                <th scope="col">出发地</th>
                <th scope="col">到达地</th>
                <th scope="col">出发机场</th>
                <th scope="col">到达机场</th>
                <th scope="col">出发时间</th>
                <th scope="col">到达时间</th>
                <th scope="col">票价</th>
                <th scope="col">创建时间</th>
                <th scope="col">--</th>
              </tr>
            </thead>
            <tbody>
              <#if retCode??>
              	<tr>
                <td colspan="15" style="text-align:center;">暂无结果展示</td>
              	</tr>
              <#else>
              	<#if resultList??>
					<#list resultList as rs>
						<tr>
			                <#--<th scope="row">${rs['id']}</th>-->
			                <td>${rs['flightNumber']}</td>
			                <td>${rs['flightCompany']}</td>
			                <td>${rs['flightModel']}</td>
			                <td>${rs['departurePlace']}</td>
			                <td>${rs['arrivalPlace']}</td>
			                <td>${rs['departureAirport']}</td>
			                <td>${rs['arrivalAirport']}</td>
			                <td>${rs['departureTime']}</td>
			                <td>${rs['arrivalTime']}</td>
			                <td>${rs['price']?string.currency}</td>
			                <td>${rs['createTime']?string('yyyy-MM-dd HH:mm:ss')}</td>
			                <td><a href="/admin/update_flight.html?id=${rs['id']}">编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/admin/do_delete_flight.html?id=${rs['id']}">删除</a></td>
		              	</tr>
					</#list>
				</#if>
              </#if>
            </tbody>
          </table>
        </div>
        <div style="padding-top:10px; padding-bottom:10px; float:right;">
	        <button type="button" class="btn btn-outline-primary" style="margin-right:10px;" onclick="prePage();" id="btnPrePage">上一页</button>
	        <button type="button" class="btn btn-outline-primary" id="btnNextPage" onclick="nextPage();">下一页</button>
        </div>
    </div>
    </div>
    </div>
    <!-- /.content --> 
  </div>
  <script>
    var thisPageUrl = window.location.href;
  	var nowPage = ${pageNow};
  	var pageSize = ${pageSize};
  	var totalPage = ${totalPage};
    if(thisPageUrl.indexOf("?")>0){
    	thisPageUrl = thisPageUrl.substring(0,thisPageUrl.indexOf("?"));
    }
    if(nowPage==1 || totalPage==0){
    	$("#btnPrePage").removeClass("btn-outline-primary");
    	$("#btnPrePage").addClass("btn-outline-secondary");
    	$("#btnPrePage").attr("disabled","disabled");
    }
    if(nowPage==totalPage || totalPage==0){
    	$("#btnNextPage").removeClass("btn-outline-primary");
    	$("#btnNextPage").addClass("btn-outline-secondary");
    	$("#btnNextPage").attr("disabled","disabled");
    }
  	function prePage(){
  		let contPage = nowPage - 1;
  		if(contPage < 1){
  			contPage = 1;
  		}
  		thisPageUrl = thisPageUrl + "?pageNow=" + contPage + "&pageSize=" + pageSize;
  		window.location.href = thisPageUrl;
  	}
  	function nextPage(){
  		let contPage = nowPage + 1;
  		thisPageUrl = thisPageUrl + "?pageNow=" + contPage + "&pageSize=" + pageSize;
  		window.location.href = thisPageUrl;
  	}
  </script>
<#include "../footer.ftl">
</html>